package com.diandi.ddsb.bean;

/**
 * 标的状态
 * 
 * @author maliming
 *
 */

public enum YesOrNoType {

	YES(1, "是"), NO(0, "否");

	/**
	 * value
	 */
	private final String text;
	/**
	 * key
	 */
	private final int value;

	YesOrNoType(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public static YesOrNoType getByType(int type) {
		for (YesOrNoType item : YesOrNoType.values()) {
			if (item.getValue() == type) {
				return item;
			}
		}
		throw new RuntimeException(type + "不是YesOrNoType的合法type");
	}

	public String getText() {
		return text;
	}

	public int getValue() {
		return value;
	}

}
